@extends('admin.mainlayout')
@section('title')
    <div class="title"><span>品牌管理(列表)></span></div>
    <div class="header" id="a" style="
        width: 90px;
        text-align: center;
        background: #36bc9b;
        padding: 8px 0;
        color: white;
        cursor: pointer;
    "><a href="{{urlAdmin('Brand','getAdd')}}" style="color: white;">添加品牌</a>
    </div>
    <br/>
    <div class="main_top" >
        <form id='search' action="{{urlAdmin('Brand','getIndex')}}" method="get">
            <span>选择时间段</span>
            <input type="text" name="starttime" class="laydate-icon" id="hello2"/><span>到</span>
            <input type="text" name="endtime" class="laydate-icon" id="hello3"/>
            <input type="text" name="keyword" style="width: 120px;height: 21px;margin-left: 100px" placeholder="手机号/品牌名"/>
            <span id="sousuo" >搜索</span>
        </form>
    </div>
    <style type="text/css">
        #sousuo{
            display:inline-block;
            background: #347c1e;
            text-align: center;
            color:white;
            height:25px;
            width:40px;
            margin-left: 40px;
            cursor: pointer;
        }
        #sousuo:hover{
            background-color: #2d94e8;
        }
    </style>
@endsection
@section('content')
<!-- 品牌管理列表-->
    <div class="two">

        <table>
            <thead>
            <tr>
                <th>序号</th>
                <th>品牌名称</th>
                <th>负责人</th>
                <th>联系方式</th>
                <th>区域</th>
                <th>代理商人数</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            @if(!empty($rows['data']))
                @foreach($rows['data'] as $d)
            <tr>
                <td>{{$d['id']}}</td>
                <td>{{$d['title']}}</td>
                <td>{{$d['name']}}</td>
                <td>{{$d['mobile']}}</td>
                <td>{{$d['address']}}</td>
                <td>{{$d['created_at']}}</td>
                <td class="green"><a href="/center/brand/info?id={{$d['id']}}">详情</a></td>
            </tr>
                @endforeach
            @endif
            </tbody>
        </table>
        <div class="del">
            <div class="bot">
                @if($rows['prev_page_url'])
                    <p class="prev"><a href="{{$rows['prev_page_url']}}">上一页</a></p>
                @endif
                <ul>
                    @foreach($rows['pageNoList'] as $v)
                        <li @if($rows['current_page'] ==  $v )class="active_list" @endif ><a href="/center/brand?page={{$v}}">{{$v}}</a></li>
                    @endforeach
                </ul>
                @if($rows['next_page_url'])
                    <p class="next"><a href="{{$rows['next_page_url']}}">下一页</a></p>
                @endif
            </div>
        </div>
    </div>

    <script>
        //时间搜索
        var oSousuo = document.getElementById('sousuo');
        var oSearch = document.getElementById('search');

        oSousuo.onclick = function(){
            //加载效果
            layer.load(2, {shade: false});
            oSearch.submit();

        }

        laydate({
            elem: '#hello2'
        });
        laydate({
            elem: '#hello3'
        });
    </script>
@endsection